﻿<phone:PhoneApplicationPage x:Class="USElections.Newsfeed.Pages.NewsFeedsPage"
                            xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                            xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                            xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
                            xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
                            xmlns:controls="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls"
                            xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
                            xmlns:nlcontrols="clr-namespace:NorthernLights.Controls;assembly=NorthernLights.Controls"
                            xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
                            xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
                            mc:Ignorable="d"
                            d:DesignWidth="480"
                            d:DesignHeight="696"
                            FontFamily="{StaticResource PhoneFontFamilyNormal}"
                            FontSize="{StaticResource PhoneFontSizeNormal}"
                            Foreground="{StaticResource PhoneForegroundBrush}"
                            SupportedOrientations="Portrait"
                            Orientation="Portrait"
                            shell:SystemTray.IsVisible="True"
                            shell:SystemTray.Opacity="0">

    <shell:SystemTray.ProgressIndicator>
        <shell:ProgressIndicator IsIndeterminate="True"
                                 IsVisible="False"
                                 Text="Downloading..." />
    </shell:SystemTray.ProgressIndicator>

    <Grid x:Name="LayoutRoot"
          Background="Transparent">
        
        <controls:Pivot x:Name="pivot"
                        Title="US ELECTIONS - NEWS FEEDS"
                        ItemsSource="{Binding}">
            <controls:Pivot.HeaderTemplate>
                <DataTemplate>
                    <TextBlock Text="{Binding Name}" />
                </DataTemplate>
            </controls:Pivot.HeaderTemplate>
            <controls:Pivot.ItemTemplate>
                <DataTemplate>
                    <Grid>
                        <ListBox x:Name="listBox"
                                 SelectedItem="{x:Null}"
                                 ItemsSource="{Binding Items}"
                                 HorizontalAlignment="Left"
                                 VerticalAlignment="Top"
                                 ScrollViewer.VerticalScrollBarVisibility="Auto"
                                 Tap="listBoxTap"
                                 ItemTemplate="{StaticResource feedItemTemplate}">
                        </ListBox>
                    </Grid>
                </DataTemplate>
            </controls:Pivot.ItemTemplate>
        </controls:Pivot>

        <nlcontrols:Notification x:Name="notification" />
    </Grid>

    <phone:PhoneApplicationPage.ApplicationBar>
        <shell:ApplicationBar IsVisible="True"
                              IsMenuEnabled="True">
            <shell:ApplicationBarIconButton IconUri="/Icons/appbar.refresh.rest.png"
                                            Text="refresh"
                                            Click="ApplicationBarIconButtonClick" />
            <shell:ApplicationBar.MenuItems>
                <shell:ApplicationBarMenuItem Text="refresh all"
                                              Click="ApplicationBarMenuItemClick" />
            </shell:ApplicationBar.MenuItems>
        </shell:ApplicationBar>
    </phone:PhoneApplicationPage.ApplicationBar>
</phone:PhoneApplicationPage>